package com.web.pages.students;

import com.tern.data.Entity;
import com.tern.util.Trace;
import com.tern.web.PageForm;

public class StudentIndexPage extends PageForm {
	private Entity entity;
	private int stuID;

	final protected boolean onLoad() throws Exception {
		
		entity = Entity.createFromSchema("student");
		//System.out.print(session.getAttribute("userID").toString());
		stuID =Integer.parseInt(session.getAttribute("userID").toString());
		
		
		//if (!this.isPostBack) {
			retriveEntity();
			//System.out.print("entity:"+entity.getColumnCount());
		//}
		return true;
	}

	private void retriveEntity() {
		try {
			entity.retriveFromDB("stuID=" + stuID);
		} catch (Exception e) {
			Trace.out(Trace.Error, "StudentIndexPage", e);
		}
	}
	
	public Entity getStudent()
	{
		System.out.println("entity:"+entity.getRowsCount());
		System.out.println("entity:");
		return entity;
	}

	// public java.util.Map<String, Object> getSubmit() {
	// return row.getMap();
	// }

}
